home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Extras / IFF / IFF_Forms / DTYP.doc < prev    next >
Encoding:
Text File  |  1999-10-27  |  5.5 KB  |  197 lines

  1. DataTypes Identification
  2.  
  3. #ifndef  LIBRARIES_DATATYPES_H
  4. #define  LIBRARIES_DATATYPES_H
  5. /*
  6. **    $Id: datatypes.h,v 39.1 91/12/13 10:17:52 davidj Exp $
  7. **
  8. **    (C) Copyright 1991-1999 Amiga, Inc.
  9. **        All Rights Reserved
  10. */
  11. #ifndef  EXEC_TYPES_H
  12. #include <exec/types.h>
  13. #endif
  14. #ifndef  EXEC_LISTS_H
  15. #include <exec/lists.h>
  16. #endif
  17. #ifndef  EXEC_NODES_H
  18. #include <exec/nodes.h>
  19. #endif
  20. #ifndef  EXEC_LIBRARIES_H
  21. #include <exec/libraries.h>
  22. #endif
  23. #ifndef  LIBRARIES_IFFPARSE_H
  24. #include <libraries/iffparse.h>
  25. #endif
  26.  
  27. /*****************************************************************************/
  28.  
  29. #define ID_DTYP MAKE_ID('D','T','Y','P')
  30.  
  31. /*****************************************************************************/
  32.  
  33. #define ID_DTHD MAKE_ID('D','T','H','D')
  34.  
  35. struct DataTypeHeader
  36. {
  37.     STRPTR     dth_Name;                /* Descriptive name of the data type */
  38.     STRPTR     dth_BaseName;                /* Base name of the data type */
  39.     STRPTR     dth_Pattern;                /* Match pattern for file name. */
  40.     WORD    *dth_Mask;                /* Comparision mask */
  41.     ULONG     dth_GroupID;                /* Group that the DataType is in */
  42.     ULONG     dth_ID;                /* ID for DataType (same as IFF FORM type) */
  43.     WORD     dth_MaskLen;                /* Length of comparision mask */
  44.     WORD     dth_Pad;                /* Unused at present (must be 0) */
  45.     UWORD     dth_Flags;                /* Flags */
  46.     UWORD     dth_Priority;                /* Priority */
  47. };
  48.  
  49. #define    DTHSIZE    sizeof(struct DataTypeHeader)
  50.  
  51. /*****************************************************************************/
  52.  
  53. /* Basic file type */
  54. #define    DTF_TYPE_MASK    0x000F
  55. #define    DTF_BINARY    0x0000
  56. #define    DTF_ASCII    0x0001
  57. #define    DTF_IFF        0x0002
  58. #define    DTF_MISC    0x0003
  59.  
  60. /* Set if case is important */
  61. #define    DTF_CASE    0x0010
  62.  
  63. /* Reserved for system use */
  64. #define    DTF_SYSTEM1    0x1000
  65.  
  66. /*****************************************************************************
  67.  *
  68.  * GROUP ID and ID
  69.  *
  70.  * This is used for filtering out objects that you don't want.  For
  71.  * example, you could make a filter for the ASL file requester so
  72.  * that it only showed the files that were pictures, or even to
  73.  * narrow it down to only show files that were ILBM pictures.
  74.  *
  75.  * Note that the Group ID's are in lower case, and always the first
  76.  * four characters of the word.
  77.  *
  78.  * For ID's; If it is an IFF file, then the ID is the same as the
  79.  * FORM type.  If it isn't an IFF file, then the ID would be the
  80.  * first four characters of name for the file type.
  81.  *
  82.  *****************************************************************************/
  83.  
  84. /* System file, such as; directory, executable, library, device, font, etc. */
  85. #define    GID_SYSTEM    MAKE_ID ('s','y','s','t')
  86.  
  87. /* Formatted or unformatted text */
  88. #define    GID_TEXT    MAKE_ID ('t','e','x','t')
  89.  
  90. /* Formatted text with graphics or other DataTypes */
  91. #define    GID_DOCUMENT    MAKE_ID ('d','o','c','u')
  92.  
  93. /* Sound */
  94. #define    GID_SOUND    MAKE_ID ('s','o','u','n')
  95.  
  96. /* Musical instruments used for musical scores */
  97. #define    GID_INSTRUMENT    MAKE_ID ('i','n','s','t')
  98.  
  99. /* Musical score */
  100. #define    GID_MUSIC    MAKE_ID ('m','u','s','i')
  101.  
  102. /* Still picture */
  103. #define    GID_PICTURE    MAKE_ID ('p','i','c','t')
  104.  
  105. /* Animated picture */
  106. #define    GID_ANIMATION    MAKE_ID ('a','n','i','m')
  107.  
  108. /* Animation with audio track */
  109. #define    GID_MOVIE    MAKE_ID ('m','o','v','i')
  110.  
  111. /*****************************************************************************/
  112.  
  113. /* A DTCD chunk contains an embedded executable that can be loaded
  114.  * with InternalLoadSeg. */
  115. #define ID_CODE MAKE_ID('D','T','C','D')
  116.  
  117. /* DataTypes comparision hook context (Read-Only).  This is the
  118.  * argument that is passed to a custom comparision routine. */
  119. struct DTHookContext
  120. {
  121.     /* Libraries that are already opened for your use */
  122.     struct Library        *dthc_SysBase;
  123.     struct Library        *dthc_DOSBase;
  124.     struct Library        *dthc_IFFParseBase;
  125.     struct Library        *dthc_UtilityBase;
  126.  
  127.     /* File context */
  128.     BPTR             dthc_Lock;
  129.     struct FileInfoBlock    *dthc_FIB;
  130.     BPTR             dthc_FileHandle;
  131.     struct IFFHandle        *dthc_IFF;
  132.     STRPTR             dthc_Buffer;        /* Buffer */
  133.     ULONG             dthc_BufferLength;    /* Length of the buffer */
  134. };
  135.  
  136. /*****************************************************************************/
  137.  
  138. #define ID_DTTL MAKE_ID('D','T','T','L')
  139.  
  140. struct Tool
  141. {
  142.     UWORD     tn_Which;                /* Which tool is this */
  143.     UWORD     tn_Flags;                /* Flags */
  144.     STRPTR     tn_Program;                /* Application to use */
  145. };
  146.  
  147. #define    TSIZE    sizeof(struct Tool)
  148.  
  149. /* defines for tn_Which */
  150. #define    TW_INFO            1
  151. #define    TW_BROWSE        2
  152. #define    TW_EDIT            3
  153. #define    TW_PRINT        4
  154. #define    TW_MAIL            5
  155.  
  156. /* defines for tn_Flags */
  157. #define    TF_LAUNCH_MASK        0x000F
  158. #define    TF_SHELL        0x0001
  159. #define    TF_WORKBENCH        0x0002
  160. #define    TF_RX            0x0003
  161.  
  162. /*****************************************************************************/
  163.  
  164. #ifndef    DATATYPE
  165. #define    DATATYPE
  166. struct DataType
  167. {
  168.     struct Node              dtn_Node1;        /* Reserved for system use */
  169.     struct Node             dtn_Node2;        /* Reserved for system use */
  170.     struct DataTypeHeader    *dtn_Header;        /* Pointer to the DataTypeHeader */
  171.     struct List             dtn_ToolList;        /* List of tool nodes */
  172.     STRPTR             dtn_FunctionName;    /* Name of comparision routine */
  173.     ULONG             dtn_Length;        /* Length of the memory block */
  174. };
  175. #endif
  176.  
  177. #define    DTNSIZE    sizeof(struct DataType)
  178.  
  179. /*****************************************************************************/
  180.  
  181. struct ToolNode
  182. {
  183.     struct Node     tn_Node;                /* Embedded node */
  184.     struct Tool  tn_Tool;                /* Embedded tool */
  185.     ULONG     tn_Length;                /* Length of the memory block */
  186. };
  187.  
  188. #define    TNSIZE    sizeof(struct ToolNode)
  189.  
  190. /*****************************************************************************/
  191.  
  192. #ifndef    ID_NAME
  193. #define    ID_NAME    MAKE_ID('N','A','M','E')
  194. #endif
  195.  
  196. #endif   /* LIBRARIES_DATATYPES_H */
  197.